// 演示多语言的引入
import Vue from 'vue'
import VueI18n from 'vue-i18n'
// 安装插件
Vue.use(VueI18n)
// 引入 element 语言包
import enElement from 'element-ui/lib/locale/lang/en'
import zhElement from 'element-ui/lib/locale/lang/zh-CN'

// 引入自定义语言包
import enCustom from './en'
import zhCustom from './zh'
// 创建实例
export default new VueI18n({
    locale: localStorage.getItem('language') || 'zh',
    messages: {
        zh: {
          morning: '早上好',
          goodday: '祝你开心每一天',
          confirmDel: '是否确认删除?',
          ...zhElement,
          ...zhCustom
        },
        en: {
          morning: 'Good Morning',
          goodday: 'Have a nice day',
          confirmDel: 'Are you sure?',
          ...enElement,
          ...enCustom
        }
      }
})